//
//  LHBrowseCollectionCell.m
//  WXYView
//
//  Created by lehuo on 2017/1/16.
//  Copyright © 2017年 lehuo. All rights reserved.
//

#import <AssetsLibrary/AssetsLibrary.h>
#import "LHBrowseCollectionCell.h"
#import "WXYScrollView.h"
#import "PhotoAssetModel.h"
@interface LHBrowseCollectionCell()
@property(nonatomic,strong)WXYScrollView *scrollView;
@end
@implementation LHBrowseCollectionCell


- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        WXYScrollView *scrollView = [[WXYScrollView alloc] initWithFrame:self.bounds];
        //单击图片回调
        scrollView.didTap =
        ^{
            self.didTap();
        };
        self.backgroundColor = [UIColor blackColor];
        self.scrollView = scrollView;
        [self.contentView addSubview:scrollView];
    }
    return self;
}


- (void)setCellValue:(id)modelValue
{
    
    PhotoAssetModel * assetModel = modelValue;
    [self.scrollView setImg:[UIImage imageWithCGImage:[[assetModel.asset defaultRepresentation] fullScreenImage]]];
}
@end
